<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@include file="/WEB-INF/mytag.jspf"%>

<!DOCTYPE html>
<html>
<head>
<base href="<%=basePath%>">
<title>user</title>
<script type="text/javascript">
function deletePhoto(_this,id){
	//alert("我的外层的外层是："+_this.parentNode.parentNode.tagName);
	//alert("我的外层的外层的id是："+_this.parentNode.parentNode.id);
	//_this.parentNode.parentNode.remove();
	if (id == "") {
		layer.msg("请选择删除项！！");
		return;
	}
	layer.confirm('是否删除？', function(index) {
		var url = "management/vip/imgdelete/"+id;
		$.ajax({
			type : 'POST',
			url : url,
			dataType : 'json',
			success : function(data) {
				layer.msg(data.msg);
				if (data.success) {
					_this.parentNode.parentNode.remove();
				}
			}
		});
	});
	$(function(){
		$("#submitBtn").on("click",function(){
			$("#buyform").submit();
		});
	});
}
</script>
</head>
<body>
	<ol class="am-breadcrumb am-breadcrumb-slash am-padding" style="margin-bottom: 0px;">
		<li><a href="management/index">首页</a></li>
		<li><a href="management/vip/buyIndex">会员消费记录</a></li>
		<li class="am-active">会员消费记录修改</li>
	</ol>
	<div class="am-g">
		<div class="am-u-md-12">
				<div class="am-tabs am-margin">
					<ul class="am-tabs-nav am-nav am-nav-tabs">
						<li class="am-active"><a href="javascript:void(0)">会员服务记录</a></li>
					</ul>
					<div class="am-tabs-bd">
						<div class="am-tab-panel am-active">
							<div class="am-g">
								<div class="am-u-sm-12">
									<form class="am-form am-form-horizontal">
										<div class="am-form-group">
											<label class="am-u-sm-2 am-form-label">会员卡号</label>
											<div class="am-u-md-4 am-u-end">
												<input type="text" name="vipNo" id="vipNo" value="${t.vipNo}" class="am-form-field am-input-sm" readonly="readonly">
											</div>
										</div>
										<div class="am-form-group">
											<label class="am-u-sm-2 am-form-label">姓名</label>
											<div class="am-u-md-4 am-u-end">
												<input type="text" name="name" id="name" value="${t.name }" class="am-form-field am-input-sm" readOnly>
											</div>
										</div>
										<div class="am-form-group">
											<label class="am-u-sm-2 am-form-label">性别</label>
											<div class="am-u-sm-4 am-u-end am-form-label am-text-left">
												<input type="radio" name="sex" disabled="disabled" <c:if test="${t.sex eq 'M'}"> checked="checked" </c:if> value="M"> 男
												<input type="radio" name="sex" disabled="disabled" <c:if test="${t.sex eq 'F'}"> checked="checked" </c:if> value="F"> 女
											</div>
										</div>
										
										<div class="am-form-group">
											<label class="am-u-sm-2 am-form-label">手机</label>
											<div class="am-u-md-4 am-u-end">
												<input type="text" name="phoneNo" id="phoneNo" disabled="disabled" value="${t.phoneNo }" class="am-form-field am-input-sm">
											</div>
										</div>
										<!-- 
										<div class="am-form-group">
											<label class="am-u-sm-2 am-form-label">配方</label>
											<div class="am-u-md-4 am-u-end">
												<input type="text" name="formula" id="formula" value="${t.formula }" class="am-form-field am-input-sm">
											</div>
										</div>
										 -->
									</form>
								</div>
								<div class="am-u-sm-12">
									<form  id = "buyform" method="post" class="am-form am-form-horizontal" action="management/vip/hairdoupdate">
											<input type="hidden" name="hairdoRecordId" id="hairdoRecordId" value="${t.hairdoRecordId }" class="am-form-field am-input-sm"><!-- 会员id -->
											<div class="am-form-group">
												<label class="am-u-sm-2 am-form-label">本次美发时间</label>
												<div class="am-u-md-4 am-u-end">
													<input type="text" name="haircutDate" id="haircutDate" value="<fmt:formatDate value='${t.haircutDate}' type="date" pattern="yyyy-MM-dd"/>" class="am-form-field am-input-sm" data-am-datepicker readOnly>
												</div>
											</div>
											<div class="am-form-group">
												<label class="am-u-sm-2 am-form-label">建议下次美发时间</label>
												<div class="am-u-md-4 am-u-end">
													<input type="text" name="suggestNextHaircutDate" id="suggestNextHaircutDate" value="<fmt:formatDate value='${t.suggestNextHaircutDate}' type="date" pattern="yyyy-MM-dd"/>" class="am-form-field am-input-sm" data-am-datepicker readOnly>
												</div>
											</div>
											<div class="am-form-group">
												<label class="am-u-sm-2 am-form-label">建议下次服务项目</label>
												<div class="am-u-md-4 am-u-end">
													<input type="text" name="suggestNextItem" id="suggestNextItem" value='${t.suggestNextItem}'  class="am-form-field am-input-sm">
												</div>
											</div>
											<!-- 
											<div class="am-form-group">
												<label class="am-u-sm-2 am-form-label">操作人</label>
												<div class="am-u-md-4 am-u-end">
													<input type="text" name="idNo" id="idNo" value="${t.employeeName }" class="am-form-field am-input-sm">
												</div>
											</div>
											 -->
											<div class="am-form-group">
												<label class="am-u-sm-2 am-form-label">操作说明</label>
												<div class="am-u-md-4 am-u-end">
													<textarea id="operExplain" name="operExplain" rows="5" maxlength="500" class="am-form-field am-input-sm" >
														${t.operExplain }
													</textarea>
												</div>
											</div>
									</form>
								</div>
								<div class="am-u-sm-12">
									<div class="am-form-group">
										<div class="am-u-md-2 am-text-left">发型照片</div>
										<br>
										<div class="am-u-md-10 am-u-end">
											<c:if test="${!empty imgs }">
												<c:forEach var="hairdoimg" items="${imgs}">
													<div class="am-u-md-4 am-u-end">
														<img id="imgId" src="${hairdoimg.img }" class="am-form-field am-input-sm">
														<div class="gallery-desc">
															<a href="management/vip/imgedit/${hairdoimg.hairdoImgId }" class="am-btn am-btn-primary am-btn-xs"><span class="am-icon-check"></span> 修改</a>
															<a href="javascript:;" onclick="deletePhoto(this,'${hairdoimg.hairdoImgId}')" class="am-btn am-btn-primary am-btn-xs"><span class="am-icon-times"></span> 删除</a>
														</div>
												<br>
													</div>
												</c:forEach>
											</c:if>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
				<div class="am-margin">
					<a href="management/vip/imgadd/${t.hairdoRecordId }" class="am-btn am-btn-primary am-btn-xs" ><span class="am-icon-check"></span> 新增照片</a>
					<button class="am-btn am-btn-primary am-btn-xs" type="button" id="submitBtn" ><span class="am-icon-check"></span> 保存</button>
					<a href="management/vip/buyIndex" class="am-btn am-btn-primary am-btn-xs" ><span class="am-icon-check"></span>返回</a>
				</div>
			</form>
		</div>
	</div>
</body>
</html>
